package net.xiangcaowuyu.shiro.service.impl;

import net.xiangcaowuyu.shiro.entity.ShiroPermission;
import net.xiangcaowuyu.shiro.mapper.ShiroPermissionMapper;
import net.xiangcaowuyu.shiro.service.ShiroPermissionService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Set;

/**
 * @author laughing
 * @date 2020/10/11
 * @site https://www.xiangcaowuyu.net
 */
@Service
public class ShiroPermissionServiceImpl implements ShiroPermissionService {

    @Resource
    ShiroPermissionMapper shiroPermissionMapper;

    /**
     * 获取角色对应权限
     *
     * @param roleId 角色Id
     * @return 权限集合
     */
    @Override
    public Set<ShiroPermission> findByRoleId(long roleId) {
        return shiroPermissionMapper.findByRoleId(roleId);
    }
}
